package cn.com.cetccst.compliancecheck.checker;

import android.content.Context;

public abstract class Checker {

    protected String name;
    protected String violationDetail;
    private int action;
    private CheckResult result;
    private final CheckerType checkerType;

    Checker(CheckerType checkerType) {
        this.checkerType = checkerType;
        result = CheckResult.Pass;
    }

    public String getName() {
        return name;
    }

    public String getViolationDetail() {
        return violationDetail;
    }

    public CheckerType getType() {
        return checkerType;
    }

    public int getAction() {
        return action;
    }

    public void setAction(int action) {
        this.action = action;
    }

    public CheckResult getResult() {
        return result;
    }

    public void setResult(CheckResult result) {
        this.result = result;
    }

    public void check(Context context) {
        result = CheckResult.Pass;
    }

    //等于0就默认没开启
    public boolean isEnable() {
        return getAction() != 0;
    }
}
